package com.boco.blch.analysiser.compliance.HW.data;



import com.boco.blch.analysiser.compliance.ComplianceResolved;
import com.boco.blch.analysiser.util.XmlUtil;
/**
 * @author 黄戈
 * HBase接口认证安全基线要求项--数据节点
 *
 */
public class BOCO_Hbase_IdentityAuth_InterfaceAuth implements ComplianceResolved {
	private final static String HbaseP1 ="hbase.security.authentication.ui";
	private final static String HbaseP2="hbase.security.authentication";
	

	@Override
	public int realEchoResolved(String echoResult) {
		if(!echoResult.equals("")&&echoResult!= null&&(!echoResult.contains(NoPermission1)&&!echoResult.contains(NoPermission2)&&!echoResult.contains(NoPermission3))){
			String DataResult=echoResult;//.substring(echoResult.indexOf("Data-start")+"Data-start".length(),echoResult.indexOf("Data-end")).trim();
			if(!DataResult.contains(NotFindFile)&&!DataResult.contains("boco-HBase-result:error")){
			String HbaseResult1=XmlUtil.getValueByName(DataResult,HbaseP1);
			String HbaseResult2=XmlUtil.getValueByName(DataResult,HbaseP2);
		    if(HbaseResult1.equals("kerberos")&&HbaseResult2.equals("kerberos")){
				return SUCCESS;
			}else{
				return FAILED;
			}
		
		  }else{
			  return FAILED;
		  }
			}else{
				return FAILED;
			
			}
		
		
	}
	
	/*
*/

}
